package com.yzt.zhuju.utils;


import com.yzt.zhuju.constants.PreferenceConstant;
import com.yzt.p_base.utils.SharedPreferenceUtil;

/**
 * 功能：sp缓存的工具类
 */
public class PreferencesUtils {

    /**
     * 上一条消息的通道名称
     */
    public static int getLastMsgStatus() {
        return SharedPreferenceUtil.getInstance().getValue(PreferenceConstant.MSG_LAST_MSG_STATUS, 0);
    }

    /**
     * 通知声音
     */
    public static boolean getNotifyVoice() {
        return SharedPreferenceUtil.getInstance().getValue(PreferenceConstant.MSG_NOTICE_VOICE, true);
    }

    /**
     * 通知震动
     */
    public static boolean getNotifyVibrate() {
        return SharedPreferenceUtil.getInstance().getValue(PreferenceConstant.MSG_NOTICE_VIBRATE, true);
    }

    /**
     * 新消息气泡飘屏
     */
    public static boolean getNotifyPopFlutter() {
        return SharedPreferenceUtil.getInstance().getValue(PreferenceConstant.MSG_NOTICE_POP_FLUTTER, true);
    }

    /**
     * 显示消息详情
     *
     * @return
     */
    public static boolean isShowMessageDetail() {
        return SharedPreferenceUtil.getInstance().getValue(PreferenceConstant.SHOW_MESSAGE_DETAIL, false);
    }

    /**
     * 消息来临 是否弹出消息悬浮窗
     *
     * @return
     */
    public static boolean isMsgFloatDialog() {
        return SharedPreferenceUtil.getInstance().getValue(PreferenceConstant.NOTICE_MSG_SHOW_DIALOG, true);
    }


}
